#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class Date
{
public:
	Date(int year=2020, int month=1, int day=1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	int GetMonthDay(int year, int month)
	{
		static int arr[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		int day = arr[month];
		if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			day++;
		}
		return day;
	}
	Date operator+=(int day)
	{
		_day += day;
		while (_day > GetMonthDay(_year, _month))
		{
			_day -= GetMonthDay(_year, _month);
			_month++;
			if (_month > 12)
			{
				_month = 1;
				_year++;
			}
		}
		return *this;
	}
	bool operator==(const Date& d)
	{
		if (_year == d._year && _month == d._month && _day == d._day)
			return true;
		else
			return false;
	}
	bool operator!=(const Date& d)
	{
		return !(*this == d);
	}
	int operator-(const Date& d)
	{
		Date min = *this;
		Date max = d;
		if (_year > d._year)
		{
			min = d;
			max = *this;
		}
		if (_year == d._year && _month > d._month)
		{
			min = d;
			max = *this;
		}
		if (_year == d._year && _month == d._month && _day > d._day)
		{
			min = d;
			max = *this;
		}
		int countDay = 0;
		while (min != max)
		{
			countDay++;
			min += 1;
		}
		return countDay;
	}
private:
	int _year;
	int _month;
	int _day;
};
int get_day(int x)
{
	int num1 = x % 10;
	x = x / 10;
	int num2 = x % 10;
	return num1 + num2 * 10;
}
int get_month(int x)
{
	x = x / 100;
	int num1 = x % 10;
	x = x / 10;
	int num2 = x % 10;
	return num1 + num2 * 10;
}
int get_year(int x)
{
	return x / 10000;
}
int main()
{
	int x1, x2;
	cin >> x1;
	cin >> x2;
	int a1, b1, c1;
	int a2, b2, c2;
	a1 = get_year(x1);
	a2 = get_year(x2);
	b1 = get_month(x1);
	b2 = get_month(x2);
	c1 = get_day(x1);
	c2 = get_day(x2);
	Date d1(a1, b1, c1);
	Date d2(a2, b2, c2);
	int ret = d1 - d2 + 1;
	cout << ret << endl;
	return 0;
}